<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
<title>栏目管理</title>
<meta name="decorator" content="default" />
<%@include file="/WEB-INF/views/include/treetable.jsp"%>
<script type="text/javascript">
	function page(n, s) {
		$("#pageNo").val(n);
		$("#pageSize").val(s);
		$("#searchForm").submit();
		return false;
	}
	
	function autoRowSpan(tb, row, col) {
		var lastValue = "", value = "", pos = 1;
		for (var i = row; i < tb.rows.length; i++) {
			value = tb.rows[i].cells[col].innerText;
			if (lastValue == value) {
				tb.rows[i].deleteCell(col);
				tb.rows[i - pos].cells[col].rowSpan = tb.rows[i - pos].cells[col].rowSpan + 1;
				pos++;
			} else {
				lastValue = value;
				pos = 1;
			}
		}
	}
	$(document).ready(function() {
		autoRowSpan(contentTable, 0, 0);
		$("td,th").css({
			"text-align" : "center",
			"vertical-align" : "middle"
		});
	});
</script>

</head>
<body>
	<ul class="nav nav-tabs">
		<li class="active"><a href="${ctx}/oa/workOrder/">工单列表</a></li>
		<%-- <shiro:hasPermission name="cms:category:edit">
			<li><a href="${ctx}/oa/workOrder/form">${fns:getUser().name}</a></li>
		</shiro:hasPermission> --%>
	</ul>
	<sys:message content="${message}" />
	
	
	<form id="searchForm">
		<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
		<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
	</form>

	<table id="contentTable"
		class="table table-bordered table-condensed">
		<tr>
			<th>编号</th>
			<th>工单号</th>
			<th>操作人</th>
			<th>服务提供方</th>
			<th>服务调用方</th>
			<th>服务调用时间</th>
			<th>紧急程度</th>
			<th>重复投诉次数</th>
			<th>投诉分类</th>
			<th>操作时间</th>
			<th>操作</th>
		</tr>
		<c:forEach items="${page.list}" var="workOrder">
			<tr id="${workOrder.id}" class="${workOrder.wobj}">
				<td>${workOrder.id }</td>
				<td><a href="${ctx}/oa/workOrder/form?id=${workOrder.id}">${workOrder.serialNo}</a></td>
				<td>${workOrder.opPerson}</td>
				<td>${workOrder.serSupplier }</td>
				<td>${workOrder.serCaller }</td>
				<td>${workOrder.callTime}</td>
				<td>${workOrder.urgentDegree}</td>
				<td>${workOrder.repeatComplaintTimes}</td>
				<td>${workOrder.title}</td>
				<td>${workOrder.opTime }</td>
				<td>
					<a href="${ctx}/oa/workOrder/form?id=${workOrder.id}">处理</a>
					<a href="${ctx}/oa/workOrder/sendBack?id=${workOrder.id}" onclick="return confirmx('确定退回到工单池？', this.href)">释放</a>
				</td>
			</tr>
		</c:forEach>
	</table>
	<div class="pagination">${page}</div>
</body>
</html>